package fr.vvins.core.user.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.dao.EntityImpl;

/**
 * UserContact entity
 */
@Entity
@Table(schema="vvins", name="VV_USER_CONTACT")
public class UserContact extends EntityImpl implements Serializable {

	private static final long serialVersionUID = -7535917371737088208L;
	@Id
	@GeneratedValue
	@Column(name="ID")
	private Integer id;	
	@ManyToOne
	@JoinColumn(name="USER_ID")
	private User user;
	@ManyToOne
	@JoinColumn(name="CONTACT_ID")
	private Contact contact;
	@Basic
	@JoinColumn(name="TYPE")
	private String type;

	public UserContact() {
	}

	public UserContact(Integer id, User user, Contact contact, String type) {
		super();
		this.id = id;
		this.user = user;
		this.contact = contact;
		this.type = type;
	}

	@Override
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Contact getContact() {
		return contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	

}
